Skip to content

gh-138584: Fix missing type2test in Lib/tests/list_tests.py#138586

Closed
dbXD320 wants to merge 3 commits into
python:mainfrom
dbXD320:fix-missing-type2test
Closed

gh-138584: Fix missing type2test in Lib/tests/list_tests.py#138586
dbXD320 wants to merge 3 commits into
python:mainfrom
dbXD320:fix-missing-type2test

Conversation

@dbXD320

@dbXD320 dbXD320 commented Sep 6, 2025

Copy link
Copy Markdown
Contributor

This PR updates three tests in Lib/test/list_tests.py (CommonTest) to consistently use self.type2test instead of directly constructing a list (or []).

test_getitem_error

test_setitem_error

test_constructor_exception_handling

Previously, these tests only applied to the builtin list, and skipped other list-like classes (such as collections.UserList) that reuse CommonTest.

By switching to self.type2test, the tests now correctly apply to all list-like types under test, ensuring consistency across the test suite.

fixes #138584


📚 Documentation preview 📚: https://cpython-previews--138586.org.readthedocs.build/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lib/tests/list_tests.py is missing type2test in a few methods

2 participants